package com.ctv.my.customview.MaiCustomView.CitySelector.util;


import com.ctv.my.customview.MaiCustomView.CitySelector.bean.Province;

import java.util.Comparator;

/**
 * Created by ms on 2017/7/11.
 */

public class PinyinComparator implements Comparator<Province> {
    @Override
    public int compare(Province o1, Province o2) {
        if (o1.getSortLetters().equals("@")
                || o2.getSortLetters().equals("#")) {
            return -1;
        } else if (o1.getSortLetters().equals("#")
                || o2.getSortLetters().equals("@")) {
            return 1;
        } else {
            return o1.getSortLetters().compareTo(o2.getSortLetters());
        }
    }
}
